using System;
using System.Collections.Generic;
using System.Text;

namespace Objects
{
   public class DanhSachTheMua
    {
        #region DanhSachTheMua variables

        // id khachhang
       private int _idkhachhang;

        private String _TenChuDe;
        private String _TenMauThe;
        private String _LoaiThe;
       private String _DuongDan;
       private String _MaThanhToan;

        private int _SoLuong;
       private int _MenhGia;
       private int _ThanhTien;

        #endregion

        #region DanhSachTheMua properties

        public int idkhachhang
        {
            get { return _idkhachhang; }
            set { _idkhachhang = value; }
        }

        public String LoaiThe
        {
            get { return _LoaiThe; }
            set { _LoaiThe = value; }
        }

       public String DuongDan
       {
           get { return _DuongDan; }
           set { _DuongDan = value; }
       }

        public String TenChuDe
        {
            get { return _TenChuDe; }
            set { _TenChuDe = value; }
        }

        public String TenMauThe
        {
            get { return _TenMauThe; }
            set { _TenMauThe = value; }
        }

       public String MaThanhToan
       {
           get { return _MaThanhToan; }
           set { _MaThanhToan = value; }
       }

        public int SoLuong
        {
            get { return _SoLuong; }
            set { _SoLuong = value; }
        }

       public int MenhGia
       {
           get { return _MenhGia; }
           set { _MenhGia = value; }
       }

       public int ThanhTien
       {
           get { return _ThanhTien; }
           set { _ThanhTien = value; }
       }

        #endregion

        #region IPopulatable<DanhSachTheMua> Members

        public DanhSachTheMua Populate(System.Data.DataRow reader)
        {
            DanhSachTheMua item = new DanhSachTheMua();

            try { item.idkhachhang = Convert.ToInt32(reader["idkhachhang"].ToString()); }
            catch { item.idkhachhang = -1; }

            item.DuongDan= Convert.ToString(reader["DuongDan"].ToString());

            item.LoaiThe = Convert.ToString(reader["LoaiThe"].ToString());

            item.TenChuDe = Convert.ToString(reader["TenChuDe"].ToString());
            item.TenMauThe = Convert.ToString(reader["TenMauThe"].ToString());
            item.MaThanhToan = Convert.ToString(reader["MaThanhToan"].ToString());

            item.SoLuong = Convert.ToInt32(reader["SoLuong"].ToString());
            
            item.MenhGia = Convert.ToInt32(reader["MenhGia"].ToString());
            item.ThanhTien = Convert.ToInt32(reader["ThanhTien"].ToString());

            return item;
        }

        #endregion
    }
}
